package work20241129.oop4;

/**
 * @author zdl
 * @date 2024/11/29
 */
public class Demo1 {
    public static void main(String[] args) {
        Rat rat = new Rat();
        rat.name="小鼠";
        rat.age=2;
        rat.sex='公';
        System.out.println(rat.name);
        System.out.println(rat.age);
        System.out.println(rat.sex);
        rat.hole();
        System.out.println();

        Cow cow = new Cow();
        cow.name="小牛";
        cow.age=5;
        cow.sex='公';
        System.out.println(cow.name);
        System.out.println(cow.age);
        System.out.println(cow.sex);
        cow.milk();


        System.out.println();
        Tiger tiger = new Tiger();
        tiger.name="小牛";
        tiger.age=5;
        tiger.sex='公';
        System.out.println(tiger.name);
        System.out.println(tiger.age);
        System.out.println(tiger.sex);
        tiger.king();

        System.out.println();
        Rabbit rabbit = new Rabbit();
        rabbit.name="小牛";
        rabbit.age=5;
        rabbit.sex='公';
        System.out.println(rabbit.name);
        System.out.println(rabbit.age);
        System.out.println(rabbit.sex);
        rabbit.carrot();

    }
}
